<template>
	<view class="cuoti__page">
		<image class="cuoti-title__item" src="../../static/cuoti.jpg"></image>
		<template v-for="(temp, index) in notes">
			<view>
				<view class="index__item">{{index}}</view>
				<QShowCard :nowQ="temp" checked="-1"></QShowCard>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isright: 0,
				notesIdGroup: [],
				notes: []
			};
		},
		onLoad(option) {
			// console.log(option.isright)
			// this.isright = option.isright;
			this.main();
		},
		methods: {
			async main() {
				await this.searchnotebyuid();
				const qids = this.notesIdGroup.map(v => {
					return v.qid
				})
				await this.gettestbyids(qids);
			},
			async searchnotebyuid() {
				const [err, res] = await this.$https({
					url: '/wechat/searchnotebyuid',
					method: "POST",
					data: {
						isright: this.isright
					}
				})
				this.notesIdGroup = res.data.data;
			},
			async gettestbyids(qids) {
				const [err, res] = await this.$https({
					url: '/wechat/gettestbyids',
					method: "POST",
					data: {
						qids: qids.toString()
					}
				})
				this.notes = res.data.data;
			}
		}
	}
</script>

<style lang="scss">
	.cuoti__page {
		min-height: 100vh;
		background-color: #F1F1F1;

		.cuoti-title__item {
			width: 100vw;
			height: calc(100vw / (750 / 296));
		}

		.index__item {
			width: 20px;
			height: 20px;
			border-radius: 50%;
			font-size: 12px;
			text-align: center;
			line-height: 20px;
			margin: 20px auto 0;
			color: #fff;
			background-color: $miva-color-base;
		}
	}
</style>
